<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorator="template">
<body>
<th:block layout:fragment="content">

    <link rel="stylesheet" type="text/css" href="/css/console.css" />

    <div class="container console">
        <div class="row">
            <div class='col-sm-12'>
                <ul>
                    <li id="showGs" style="display:none;">
                        <div class="title" th:text="${session.userName}"></div>
                        <div class="mess">
                            <dl class="row">
                                <dt class="col-sm-5">账户余额：</dt>
                                <dd class="col-sm-7"><span th:text="${company.balance}"></span>分 <a class="pull-right" id="rechargeHId" onclick="chongzhi();">充值</a></dd>
                            </dl>
                            <dl class="row">
                                <dt class="col-sm-5">已购买产品：</dt>
                            </dl>

                            <dl class="row" th:each="pt, ptStat : ${products}" th:if="${products}">
                                <dt class="col-sm-1"></dt>
                                <dd class="col-sm-11">
                                    <p><span class='label label-warning' th:text="${pt.product_name}"></span></p>
                                    <p class="c999" th:text="${'有效期:' + #dates.format(pt.end_time,'yyyy-MM-dd HH:mm:ss')}"></p>
                                    <p>
                                        <button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#renew">
                                            续费</button>
                                    </p>
                                </dd>
                            </dl>


                           <!--  <dl class="row">
                               <dt class="col-sm-5">密码操作：</dt>
                               <dd class="col-sm-7">
                                   <button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#changePass">
                                       修改密码</button>
                               </dd>
                           </dl> -->
                        </div>
                    </li>
                    <li id="showDls"  style="display:none;">
                        <div class="title">代理商信息</div>
                        <div class="mess">
                            <dl class="row">
                                <dt class="col-sm-5">姓名：</dt>
                                <dd class="col-sm-7">张三</dd>
                            </dl>
                            <dl class="row">
                                <dt class="col-sm-5">手机号：</dt>
                                <dd class="col-sm-7">张三</dd>
                            </dl>
                            <dl class="row">
                                <dt class="col-sm-5">账户余额：</dt>
                                <dd class="col-sm-7">
                                    100元
                                    <a class="btn btn-primary btn-sm cash" href="">提现</a>
                                </dd>
                            </dl>
                            <dl class="row">
                                <dt class="col-sm-5">一级返点：</dt>
                                <dd class="col-sm-7">张三</dd>
                            </dl>
                            <dl class="row">
                                <dt class="col-sm-5">二级返点：</dt>
                                <dd class="col-sm-7">张三</dd>
                            </dl>
                            <dl class="row">
                                <dt class="col-sm-5">三级返点：</dt>
                                <dd class="col-sm-7">张三</dd>
                            </dl>
                            <dl class="row">
                                <dt class="col-sm-5">邀请地址：</dt>
                                <dd class="col-sm-7">http://register.xxxx.com?invite=138888888</dd>
                            </dl>
                        </div>
                    </li>
                    <li>
                        <div class="title">资费信息</div>
                        <div class="mess">
                            <dl class="row">
                                <dt class="col-sm-5">短信：</dt>
                                <dd class="col-sm-7" th:text="${'0.0' + company.smRate + '元/条'}"></dd>
                            </dl>
                            <dl class="row">
                                <dt class="col-sm-5">语音：</dt>
                                <dd class="col-sm-7" th:text="${'0.0' + company.voiceRete + '元/分钟'}"></dd>
                            </dl>
                        </div>
                    </li>

                </ul>
            </div>
        </div>
    </div>

    <div class="modal inmodal" id="renew" tabindex="-1" role="dialog" aria-hidden="true" style="display: none;">
        <div class="modal-dialog">
            <div class="modal-content animated flipInY">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
                    <h4 class="modal-title">续费</h4>
                </div>
                <small class="font-bold">
                    <div class="modal-body dl-box">
                        <dl class="row">
                            <dt class="col-sm-5">套餐名：</dt>
                            <dd class="col-sm-7">
                                <input type="radio" name="tcname" value=""><span>进销存</span>
                                <input type="radio" name="tcname" value=""><span>MRP</span>
                            </dd>
                        </dl>
                        <dl class="row">
                            <dt class="col-sm-5">有效期：</dt>
                            <dd class="col-sm-7">3个月</dd>
                        </dl>
                        <dl class="row">
                            <dt class="col-sm-5">费用：</dt>
                            <dd class="col-sm-7">1500元</dd>
                        </dl>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                        <button type="button" class="btn btn-primary">保存s</button>
                    </div>
                </small>
            </div>
            <small class="font-bold">small>
        </div>
        <small class="font-bold"></small>
    </div>


    <script th:inline="javascript">
        $(function () {
            /*<![CDATA[*/
                var isAgent = [[${isAgent}]];
            /*]]>*/
            if(isAgent == 1){
                $("#showDls").show();

            }
            if(isAgent == 2){
                $("#showGs").show();
            }
        });

        function chongzhi(){
            parent.$("#rechargeId").trigger('click');
        }
    </script>

</th:block>
</body>
</html>
